package com.aos.erp.schools.service.mq;

import com.aos.erp.schools.model.student.dto.GovExNewStudentDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class StudentSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    //发送消息
    public void sendStudent(List<GovExNewStudentDTO> dto) {
        log.info("提交122数据: " + dto);
        this.rabbitTemplate.convertAndSend("to_gov_new_student", dto);
    }

}